<template>
  <div>
    <h1>{{$store.state.count}}</h1>
    <button @click='add'>+</button>
    <Child />
  </div>
</template>
<script>
// @ is an alias to /src
import Child from "./components/child.vue";
export default {
  name: "XXX",
  data() {
    return {};
  },
  components: { Child },
  created() {
    console.log(this);
  },
  methods: {
    add() {
      // this.$store.state.count += 10;
      // this.$store.commit("changCount", 30);
      this.$store.commit({
        type: "changCount",
        qqq: 10,
      });
    },
  },
};
</script>
<style lang="less">
</style>